package com.hill;

public class ArrayReverse {


    public static void main(String[] args) {
        int[] aaa ={1,2,3,4,5,7,9,11};
        printArray(aaa);
        System.out.println();
        int[] bbb=reverse(aaa);
        printArray(bbb);

    }

    public static int[] reverse(int[] arrays){
        int[] result = new int[arrays.length];
        //反转
        for (int i=0,j=result.length-1;i<arrays.length;i++,j--){
            result[j]=arrays[i];
        }
        return result;
    }
    public static void printArray(int[] arrays){
        for (int i=0;i<arrays.length;i++)
            System.out.print(arrays[i]+"\t");

    }
}
